import request from '@/utils/request'

export function login(data) {
  return request.post('/api/sys/login', data)
}

export function getInfo(token) {
  return request({
    url: '/vue-admin-template/user/info',
    method: 'get',
    params: { token }
  })
}

export function getProfile() {
  return request.post('/api/sys/profile')
}

// 获取用某个用户的信息
export function getUserDetailById(id) {
  return request({
    url: `/api/sys/user/${id}`
  })
}

export function logout() {
  return request({
    url: '/vue-admin-template/user/logout',
    method: 'post'
  })
}
